package com.pinda.controller;

import com.pinda.authorization.entity.Menu;
import com.pinda.commonutils.Result;
import com.pinda.commonutils.StatusCode;
import com.pinda.service.MenuService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 菜单 前端控制器
 * </p>
 *
 * @author 黄杰
 * @since 2023-06-13
 */
@RestController
@RequestMapping("/menu")
public class MenuController {
    @Resource
    private MenuService menuService;

    /**
     *  TODO 根据用户id查询具有的菜单
     * @return Result<List<PdAuthMenu>>
     */
    @RequestMapping("findMenuByUserId/{id}")
    public Result<List<Menu>> findMenuByUserId(@PathVariable("id") String userId){
        return new Result<List<Menu>>(true, StatusCode.OK, "查询成功",this.menuService.findMenuByUserIdService(userId));
    }
}







